package com.icbc.springcloud.service;

import com.icbc.springcloud.pojo.Dept;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

import java.util.List;
//hystrix服务降级
@Component
public class DeptClientServiceFallbackFactory implements DeptClientService {

    public Dept queryById(long id) {
        Dept dept=new Dept();
        dept.setDeptno((int) id);
        dept.setDname("id=>"+id+"没有对应的信息，客户端提供了服务降级信息，这个服务已经被关闭了");
        dept.setDb_source("noMySQL DateBase");
        return dept;
    }

    public List<Dept> queryAll() {
        return null;
    }

    public boolean addDept(Dept dept) {
        return false;
    }
}
